/**
 * @BasicObjectFormat.as
 * 
 * @author sodaChen mail:asframe@qq.com
 * @version 1.0
 * <br>Copyright (C), 2010-2015 asFrame.com
 * <br>This program is protected by copyright laws.
 * <br>Program Name:ASFrame Log
 * <br>Date:2016-4-28
 */
package com.asframe.log.format
{
	import com.asframe.log.LogFormat;
	
	/**
	 *
	 * @author sodaChen
	 * Date:2016-4-28
	 */
	public class BasicObjectFormat implements IObjectFormat
	{
		protected var logFormat:LogFormat;
		
		public function setLogFormat(logFormat:LogFormat):void
		{
			this.logFormat = logFormat;
		}
		
		public function toFormatString(classPath:String,object:Object):String
		{
			return "/////////////[" + classPath + "]/////////////\n{" + onFormatString(object) + "}/////////////////////////";
		}
		/**
		 * 子类重写对象的格式化输出
		 * @param object
		 * @return 
		 * 
		 */		
		protected function onFormatString(object:Object):String
		{
			throw new Error("必须实现BasicObjectFormat的onFormatString方法");
		}
	}
}